<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        window.onload=function fx(){
            var a,b,c,d,e;
            var i;
              
        for(i=10000;i<=99999;i++)
        {
                a=parseInt(i/10000);
               a=a%10;
               b=parseInt(i/1000);
               b=b%10;
               c=parseInt(i/100);
               c=c%10;
               d=parseInt(i/10);
               d%=10;
               e=i%10;
            if(a===e&&b===d&&(a+1)===b&&(b+1)===c)
            console.log(i);
           
        }
         }
        
    </script>
</body>
</html>